# from PIL import Image

# img = Image.open("test.png")

# print(img.format) # ==> PNG
# print(img.size) # ==> (1024, 1024)
# print(img.mode) # ==> RGB

# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
from PIL import Image

image = Image.open("test.png")

width, height = image.size
resized_img = image.resize((int(width * 0.1), int(height * 0.1)))

resized_img.save("resized.png")

# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

# from PIL import Image, ImageOps

# size = (100, 100)

# with Image.open("phone.png") as image:
#     ImageOps.contain(image, size).save("phone_resized_1.jpg")
#     ImageOps.cover(image, size).save("phone_resized_2.jpg")
#     ImageOps.fit(image, size).save("phone_resized_3.jpg")
#     ImageOps.pad(image, size, color="#f00").save("phone_resized_4.jpg")